# 上传文件
from selenium import webdriver
import time
import os
driver = webdriver.Chrome()
url = "file:///" + os.path.abspath("upload_file.html")
driver.get(url)
driver.maximize_window()
time.sleep(3)
driver.find_element_by_name("file").send_keys("C:\\temp\\demo\\demo1\\demo1.txt")
time.sleep(3)
driver.quit()